<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <title>spilit</title>
    <style>
        div{
            width: 550px;
            height: 700px;    
            margin-left: auto;
            margin-right: auto;
        }
        .Code{
            width: 400px;
            height: 160px;
            background: #cccccc;
        }
    </style>
    <script>
        var Arr=['1','2','3','4','5','6','7','8','9'];
        Arr.splice(5,2);
        alert(Arr);
        Arr.splice(5,0,'a','b','c','d')
        alert(Arr);
        Arr.splice(5,2,'0','2');
        alert(Arr);
    </script>
</head>

<body>
    <div>
        <textarea class="Code">
            <script>
                var Arr=['1','2','3','4','5','6','7','8','9'];
                Arr.splice(5,2);//删除
                alert(Arr);
                Arr.splice(5,0,'a','b','c','d')//增加
                alert(Arr);
                Arr.splice(5,2,'0','2');//替换
                alert(Arr);
            </script>
        </textarea>
    </div>
</body>
</html>